//
//  wodezhanghuViewController.m
//  个人信息
//
//  Created by IOSchengxuyuan on 15/11/30.
//  Copyright © 2015年 com.ppfur. All rights reserved.
//

#import "wodezhanghuViewController.h"
#import "shenqingtixianViewController.h"
@interface wodezhanghuViewController (){
    float aa,bb;
    float width,height;
    UITableViewCell*cell;
}

@end

@implementation wodezhanghuViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    _mytable.delegate=self;
    _mytable.dataSource=self;
    width=[UIScreen mainScreen].bounds.size.width;
    height=[UIScreen mainScreen].bounds.size.height;
    aa=width/320;
    bb=height/568;
    _mytable.frame=CGRectMake(0, 0, width, height-200);
    _mytable.scrollEnabled=NO;
    _bbbbb.frame=CGRectMake(36*aa, 320*bb, 249*aa, 41*bb);
        
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 4;
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 60;
}
-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
    return 2;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    static NSString *id=@"row";
    cell=[tableView dequeueReusableCellWithIdentifier:id];
    if (cell==nil)
    {
        cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:id];
    }
    NSArray *row1=[cell.contentView subviews];
//    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    for (UIView *vv2 in row1)
    {
        [vv2 removeFromSuperview];
    }
    
    if(width==375){
        if (indexPath.row==0) {
            UILabel*ll1=[[UILabel alloc] initWithFrame:CGRectMake(15, 15, 100, 20)];
            ll1.font=[UIFont systemFontOfSize:15.0f];
            ll1.text=@"我的积分余额";
            [cell.contentView addSubview:ll1];
            UILabel*ll2=[[UILabel alloc] initWithFrame:CGRectMake(280, 15, 60, 20)];
            ll2.font=[UIFont systemFontOfSize:15.0f];
            ll2.text=@"400积分";
            [cell.contentView addSubview:ll2];
            
            
        }else if(indexPath.row==1){
            UILabel*ll1=[[UILabel alloc] initWithFrame:CGRectMake(15, 15, 100, 20)];
            ll1.font=[UIFont systemFontOfSize:15.0f];
            ll1.text=@"活动积分积分";
            [cell.contentView addSubview:ll1];
            UILabel*ll2=[[UILabel alloc] initWithFrame:CGRectMake(280, 15, 80, 20)];
            ll2.font=[UIFont systemFontOfSize:15.0f];
            ll2.text=@"400积分";
            [cell.contentView addSubview:ll2];
        }else if (indexPath.row==2){
            UILabel*ll1=[[UILabel alloc] initWithFrame:CGRectMake(15, 15, 100, 20)];
            ll1.font=[UIFont systemFontOfSize:15.0f];
            ll1.text=@"消费积分";
            [cell.contentView addSubview:ll1];
            UILabel*ll2=[[UILabel alloc] initWithFrame:CGRectMake(280, 15, 80, 20)];
            ll2.font=[UIFont systemFontOfSize:15.0f];
            ll2.text=@"4300积分";
            [cell.contentView addSubview:ll2];
        }else{
            UILabel*ll1=[[UILabel alloc] initWithFrame:CGRectMake(15, 15, 100, 20)];
            ll1.font=[UIFont systemFontOfSize:15.0f];
            ll1.text=@"我的RMB余额";
            [cell.contentView addSubview:ll1];
            UILabel*ll2=[[UILabel alloc] initWithFrame:CGRectMake(280, 15, 80, 20)];
            ll2.font=[UIFont systemFontOfSize:15.0f];
            ll2.text=@"400元";
            [cell.contentView addSubview:ll2];
        }
    }else if(width==320){
        if (indexPath.row==0) {
            UILabel*ll1=[[UILabel alloc] initWithFrame:CGRectMake(15, 15, 100, 20)];
            ll1.font=[UIFont systemFontOfSize:13.0f];
            ll1.text=@"我的积分余额";
            [cell.contentView addSubview:ll1];
            UILabel*ll2=[[UILabel alloc] initWithFrame:CGRectMake(240, 15, 60, 20)];
            ll2.font=[UIFont systemFontOfSize:13.0f];
            ll2.text=@"400积分";
            [cell.contentView addSubview:ll2];
            
            
        }else if(indexPath.row==1){
            UILabel*ll1=[[UILabel alloc] initWithFrame:CGRectMake(15, 15, 100, 20)];
            ll1.font=[UIFont systemFontOfSize:13.0f];
            ll1.text=@"活动积分";
            [cell.contentView addSubview:ll1];
            UILabel*ll2=[[UILabel alloc] initWithFrame:CGRectMake(240, 15, 60, 20)];
            ll2.font=[UIFont systemFontOfSize:13.0f];
            ll2.text=@"400积分";
            [cell.contentView addSubview:ll2];
        }else if (indexPath.row==2){
            UILabel*ll1=[[UILabel alloc] initWithFrame:CGRectMake(15, 15, 100, 20)];
            ll1.font=[UIFont systemFontOfSize:13.0f];
            ll1.text=@"消费积分";
            [cell.contentView addSubview:ll1];
            UILabel*ll2=[[UILabel alloc] initWithFrame:CGRectMake(240, 15, 60, 20)];
            ll2.font=[UIFont systemFontOfSize:13.0f];
            ll2.text=@"4300积分";
            [cell.contentView addSubview:ll2];
        }else{
            UILabel*ll1=[[UILabel alloc] initWithFrame:CGRectMake(15, 15, 100, 20)];
            ll1.font=[UIFont systemFontOfSize:13.0f];
            ll1.text=@"我的RMB余额";
            [cell.contentView addSubview:ll1];
            UILabel*ll2=[[UILabel alloc] initWithFrame:CGRectMake(240, 15, 60, 20)];
            ll2.font=[UIFont systemFontOfSize:13.0f];
            ll2.text=@"400元";
            [cell.contentView addSubview:ll2];
        }
        
    }else{
        if (indexPath.row==0) {
            UILabel*ll1=[[UILabel alloc] initWithFrame:CGRectMake(15, 15, 100, 20)];
            ll1.font=[UIFont systemFontOfSize:15.0f];
            ll1.text=@"我的积分余额";
            [cell.contentView addSubview:ll1];
            UILabel*ll2=[[UILabel alloc] initWithFrame:CGRectMake(320, 15, 60, 20)];
            ll2.font=[UIFont systemFontOfSize:15.0f];
            ll2.text=@"400积分";
            [cell.contentView addSubview:ll2];
            
            
        }else if(indexPath.row==1){
            UILabel*ll1=[[UILabel alloc] initWithFrame:CGRectMake(15, 15, 100, 20)];
            ll1.font=[UIFont systemFontOfSize:15.0f];
            ll1.text=@"活动积分";
            [cell.contentView addSubview:ll1];
            UILabel*ll2=[[UILabel alloc] initWithFrame:CGRectMake(320, 15, 60, 20)];
            ll2.font=[UIFont systemFontOfSize:15.0f];
            ll2.text=@"400积分";
            [cell.contentView addSubview:ll2];
        }else if (indexPath.row==2){
            UILabel*ll1=[[UILabel alloc] initWithFrame:CGRectMake(15, 15, 100, 20)];
            ll1.font=[UIFont systemFontOfSize:15.0f];
            ll1.text=@"消费积分";
            [cell.contentView addSubview:ll1];
            UILabel*ll2=[[UILabel alloc] initWithFrame:CGRectMake(320, 15, 100, 20)];
            ll2.font=[UIFont systemFontOfSize:15.0f];
            ll2.text=@"4300积分";
            [cell.contentView addSubview:ll2];
        }else{
            UILabel*ll1=[[UILabel alloc] initWithFrame:CGRectMake(15, 15, 100, 20)];
            ll1.font=[UIFont systemFontOfSize:15.0f];
            ll1.text=@"我的RMB余额";
            [cell.contentView addSubview:ll1];
            UILabel*ll2=[[UILabel alloc] initWithFrame:CGRectMake(320, 15, 60, 20)];
            ll2.font=[UIFont systemFontOfSize:15.0f];
            ll2.text=@"400元";
            [cell.contentView addSubview:ll2];
        }
        
    }    return cell;
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    
    [tableView deselectRowAtIndexPath:indexPath animated:NO];
}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

- (IBAction)sqrmbtx:(id)sender {
    shenqingtixianViewController*tixian=[[UIStoryboard storyboardWithName:@"Main" bundle:nil]instantiateViewControllerWithIdentifier:@"shenqingtixian"];
    [self.navigationController pushViewController:tixian animated:YES];
}
@end
